package com.composite.demo2;

import java.util.ArrayList;
import java.util.List;

/**
 * 树枝结构
 *
 * @author zhangsulei
 *
 */
public class Bags extends BagAndGoods {

	private List<BagAndGoods> goods = new ArrayList<>();

	public void add(BagAndGoods good) {
		goods.add(good);
	}

	@Override
	public void show() {
		for (BagAndGoods good : goods) {
			good.show();
		}
	}

}